﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using EIS.ClientUtility;
using EIS.Obj;

namespace EIS.Main
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(true);
                Logon logonWindow = new Logon();
                logonWindow.ShowDialog();
                if ((GlobalVariable.Instance.LogonResult != null) && (GlobalVariable.Instance.LogonResult.Succeed.ToUpper() == "Y"))
                    Application.Run(new MainWindow());
            }
            catch (Exception ex)
            {

                Error.WriteEventLog(ex.InnerException == null ? ex.Message : ex.InnerException.Message, ex.InnerException == null ? ex.StackTrace : ex.InnerException.StackTrace);

                ShowErrorMessageBox.Show(ex.InnerException == null ? ex.Message : ex.InnerException.Message);
            }
        }
    }
}
